package com.gykj.transactional.controller;

import com.gykj.transactional.service.ITransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: zhaojl
 * @Date: 2019/1/16 上午8:56
 * @Version: 1.0
 */
@RequestMapping("/transaction")
@RestController
public class Transaction {

    @Autowired
    ITransaction iTransaction;

    @RequestMapping("/test")
    public Object test(String name, int id){
        Map map = new HashMap<>(5);
        map.put("name",name);
        map.put("id",id);
        iTransaction.addSql(map);
        List<Map> rs = iTransaction.querySql();
        return rs;
    }

}
